﻿using Microsoft.Extensions.Configuration;
using MiniFox.Configurations;

namespace DataTransfer.Core.Configurations
{
    public class ExcelImportSetting
    {
        const string NAME = "name";
        const string MAX_IMPORT_FILE_SIZE = "maxImportFileSize";
        const string PRE_IMPORT = "preImport";
        const string DATA_WRITER_TYPE = "dataWriterType";
        const string SHEETS = "sheets";
        const string MODULES = "modules";

        internal const int MAX_FILE_SIZE = 104857600;

        /// <summary>
        /// 名称
        /// </summary>
        [ConfigurationKeyName(NAME)]
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(DATA_WRITER_TYPE)]
        public string DataWriterTypeName
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(PRE_IMPORT)]
        public bool PreImport
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(MAX_IMPORT_FILE_SIZE)]
        public int MaxImportFileSize
        {
            get;
            set;
        } = MAX_FILE_SIZE;

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(SHEETS)]
        public ExcelImportSheetSettingCollection Sheets
        {
            get;
            set;
        } = [];

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationKeyName(MODULES)]
        public ProviderSettingsCollection Modules
        {
            get;
            set;
        } = [];

    }
}
